package com.file.system.mapper.system;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.file.system.entity.system.WebDictionary;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
* 字典 Mapper 接口
* @author jch
* @since 2022-07-27
*/
@Mapper
public interface WebDictionaryMapper{

    //添加字典
    int save(WebDictionary webDictionary);

    //编辑字典
    int update(@Param("ew") UpdateWrapper<WebDictionary> query);

    //编辑字典
    int updateById(WebDictionary webDictionary);

    //添加字典(批量)
    int saveBatch(@Param("list") List<WebDictionary> webDictionaryList);

    //通过id查询字典
    WebDictionary selectById(@Param("id") Long id);

    //查询字典
    List<WebDictionary> select(@Param("ew") QueryWrapper<WebDictionary> query);

    //查询字典分页
    List<WebDictionary> select(Page<WebDictionary> page, @Param("ew") QueryWrapper<WebDictionary> query);

    //查询字典数量
    int selectCount(@Param("ew") QueryWrapper<WebDictionary> query);

    //删除字典
    int removeById(WebDictionary webDictionary);
}
